#ifndef _FAL_CFG_H_
#define _FAL_CFG_H_

#include "bootloader_define.h"

/* 手动添加 */
#define FAL_DEBUG 1

#define FAL_PART_HAS_TABLE_CFG

#define FAL_ONCHIP_FLASH_DEV_NAME       "onchip_flash"
#define FAL_USING_NOR_FLASH_DEV_NAME    "spi_flash"

/* ===================== Flash device Configuration ========================= */
extern const struct fal_flash_dev stm32_onchip_flash;
extern struct fal_flash_dev spi_flash;

/* flash device table */
#define FAL_FLASH_DEV_TABLE                 \
{                                           \
    &stm32_onchip_flash,                    \
    &spi_flash,                             \
}
/* ====================== Partition Configuration ========================== */
#ifdef FAL_PART_HAS_TABLE_CFG

/* partition table */
#define FAL_PART_TABLE                                                               \
{                                                                                    \
    {FAL_PART_MAGIC_WORD,      "bl",     FAL_ONCHIP_FLASH_DEV_NAME,   0, BOOTLOADER_SIZE, 0},     \
    {FAL_PART_MAGIC_WORD,     "app",     FAL_ONCHIP_FLASH_DEV_NAME,       BOOTLOADER_SIZE,   APP_PART_SIZE, 0},       \
    {FAL_PART_MAGIC_WORD, "download",    FAL_USING_NOR_FLASH_DEV_NAME,     0,   DOWNLOAD_PART_SIZE, 0},   \
    {FAL_PART_MAGIC_WORD,  "user",       FAL_USING_NOR_FLASH_DEV_NAME,     DOWNLOAD_PART_SIZE,  USER_PART_SIZE, 0},       \
}



#endif /* FAL_PART_HAS_TABLE_CFG */

#endif /* _FAL_CFG_H_ */

